<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP 5.1.6 or newer
 *
 * @package        CodeIgniter
 * @author        ExpressionEngine Dev Team
 * @copyright    Copyright (c) 2008 - 2011, EllisLab, Inc.
 * @license        http://codeigniter.com/user_guide/license.html
 * @link        http://codeigniter.com
 * @since        Version 1.0
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * CodeIgniter Model Class
 *
 * @package        CodeIgniter
 * @subpackage    Libraries
 * @category    Libraries
 * @author        ExpressionEngine Dev Team
 * @link        http://codeigniter.com/user_guide/libraries/config.html
 */
class CI_Model
{

    /**
     * 模块的返回值
     * @var
     */
    public $return_status;

    /**
     * Constructor
     *
     * @access public
     */
    function __construct()
    {
        log_message('debug', "Model Class Initialized");

        /**
         * 对模块的返回值进行扩展
         *    0-1000 系统所用
         * 1000-2000 登陆模块使用
         */
        $this->return_status = array();
        $this->return_status[0] = "成功";
        $this->return_status[999] = "无效的返回状态";
    }

    /**
     * __get
     *
     * Allows models to access CI's loaded classes using the same
     * syntax as controllers.
     *
     * @param    string
     * @access private
     */
    function __get($key)
    {
        $CI =& get_instance();
        return $CI->$key;
    }

    /**
     * 通过返回值，获取描述性文字
     * @param $key
     */
    public function status_msg($key)
    {
        if ( is_null($key) || is_array($key) || is_object($key)) {
            return $this->return_status[999];
        }
        if( isset($this->return_status[$key])){
            return $this->return_status[$key];
        }
        else {
            return $this->return_status[999];
        }
    }
}
// END Model Class

/* End of file Model.php */
/* Location: ./system/core/Model.php */